﻿// ***************** Add albums to our html *******************//

var albumContainer = document.getElementById("album-container");

for(var i=0; i<albums.length; i++){
	
	// Create album li the album
	var li = document.createElement('li');
	li.setAttribute('id','album-'+i);
	
	// Create a header for the album
	var h1 = document.createElement('h1');
	h1.innerHTML = albums[i].title;
	
	// Create an a tag for the album
	var a = document.createElement('a');
	a.setAttribute('href','album.html?id='+i);
	
	// Add the icon for the album (could even be a photo if you like)
	var img = document.createElement('img');
	img.setAttribute('src','images/album-folder.png');
	img.setAttribute('class','album-icon');
	
	// Append both the img and the header to the li
	a.appendChild(img);
	li.appendChild(a);
	li.appendChild(h1);
	
	// Append the li to the album-container ul
	albumContainer.appendChild(li);
}






